<template>
  <div class="ma-content-block lg:flex justify-between p-4">
    <!-- CRUD 组件 -->
    <ma-crud :options="options" :columns="columns" ref="crudRef">
    </ma-crud>
  </div>
</template>
<script setup>
import { ref, reactive } from 'vue'
import basePost from '@/api/backend/basePost.js'
import { Message } from '@arco-design/web-vue'
import tool from '@/utils/tool.js'
import * as common from '@/utils/common.js'

const crudRef = ref()




const options = reactive({
  id: 'base_post',
  rowSelection: {
    showCheckedAll: true
  },
  pk: 'id',
  operationColumn: true,
  operationColumnWidth: 160,
  formOption: {
    viewType: 'modal',
    width: 600
  },
  api: basePost.getList,
  recycleApi: basePost.getRecycleList,
  add: {
    show: true,
    api: basePost.save,
    auth: ['base:post:save']
  },
  edit: {
    show: true,
    api: basePost.update,
    auth: ['base:post:update']
  },
  delete: {
    show: true,
    api: basePost.deletes,
    auth: ['base:post:delete'],
    realApi: basePost.realDeletes,
    realAuth: ['base:post:realDeletes']
  },
  recovery: {
    show: true,
    api: basePost.recoverys,
    auth: ['base:post:recovery']
  }
})

const columns = reactive([
  {
    title: "ID",
    dataIndex: "id",
    formType: "input",
    addDisplay: false,
    editDisplay: false
  },
  {
    title: "职位名称",
    dataIndex: "name",
    formType: "input",
    search: true
  },
  {
    title: "职位/岗位",
    dataIndex: "type",
    formType: "select",
    multiple: false,
    dict: {
      data: [
        {
          label: "职位",
          value: "1"
        },
        {
          label: "岗位",
          value: "2"
        }
      ],
      translation: true
    }
  }
])
</script>
<script> export default { name: 'base:post' } </script>